package babel;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;



public class Original {
	
	private File inputFile;
	private String OriginalText = "";
	private String aLine = null;
	private ArrayList result = new ArrayList();
	

	public Original(File inputFile) {
		this.inputFile = inputFile;
		
	}
	
	public String FileEinlesen() throws IOException{
		String line;
		String output=null;
		try {
			BufferedReader r = new BufferedReader(new FileReader(inputFile));
			
			
			while((line = r.readLine()) != null){
			
			output = output+" "+line+ "\n";
			}
			r.close();
		}
		catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		return output;
	}
	
	public void kopiereOriginal() throws IOException{
			
		//			int intChar = -1;

//		// Set everything up
//		char[] window = new char[20]; // Our window onto the text
//		Reader streamIn = new BufferedReader(new FileReader(inputFile));
////		analysis.clear();
//		
//		// Fill the window for the first time
//		for (int i = 0; i < 20; i++) {
//			intChar = streamIn.read();
//			window[i] = (char) intChar;
//		}
//		for (int i = 0; i < 20; i++) {
//			System.out.print(window[i]);
//			OriginalText = OriginalText + window[i];
//		}
		
//		System.out.print(OriginalText);
		GUIEingabe.setTextOriginal(this.FileEinlesen());
		GUIEingabe.setTextAusgabe("");
	}
//	public static void main(String[] args) {
//		// TODO Auto-generated method stub
//		
//	}
//private void copy(OriginalText){
//	Auswertung.GUIAuswertung();
//	TextAreaOriginal.setText(OriginalText);
//}

}
